package com.rc.pojo.po.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;

// Auto generate by mybatis-flex, do not modify it.
public class OrderTableDef extends TableDef {

    /**
     * 实体类。

 @author 27806
 @since 2024-06-15
     */
    public static final OrderTableDef ORDER = new OrderTableDef();

    /**
     * 订单id
     */
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 购买数量
     */
    public final QueryColumn NUM = new QueryColumn(this, "num");

    public final QueryColumn TYPE = new QueryColumn(this, "type");

    public final QueryColumn CON_ID = new QueryColumn(this, "con_id");

    public final QueryColumn COVER = new QueryColumn(this, "cover");

    public final QueryColumn PRICE = new QueryColumn(this, "price");

    /**
     * 商品标题
     */
    public final QueryColumn TITLE = new QueryColumn(this, "title");

    public final QueryColumn FARM_ID = new QueryColumn(this, "farm_id");

    /**
     * sku商品id
     */
    public final QueryColumn ITEM_ID = new QueryColumn(this, "item_id");

    /**
     * 订单的状态，1、未付款 2、已付款,未发货 3、已发货,未确认 4、确认收货，交易成功 5、交易取消，订单关闭 6、交易结束，已评价
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    public final QueryColumn END_TIME = new QueryColumn(this, "end_time");

    public final QueryColumn PAY_TIME = new QueryColumn(this, "pay_time");

    /**
     * 总金额，单位为分
     */
    public final QueryColumn TOTAL_FEE = new QueryColumn(this, "total_fee");

    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    public final QueryColumn COMMENT_TIME = new QueryColumn(this, "comment_time");

    public final QueryColumn CONSIGN_TIME = new QueryColumn(this, "consign_time");

    public final QueryColumn DESCRIPTION = new QueryColumn(this, "description");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, NUM, TYPE, CON_ID, COVER, PRICE, TITLE, FARM_ID, ITEM_ID, STATUS, END_TIME, PAY_TIME, TOTAL_FEE, CREATE_TIME, UPDATE_TIME, COMMENT_TIME, CONSIGN_TIME, DESCRIPTION};

    public OrderTableDef() {
        super("rc", "order");
    }

    private OrderTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public OrderTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new OrderTableDef("rc", "order", alias));
    }

}
